package com.etc.entity;

public class SkillBuff extends Skill {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8610386378700515126L;

	//添加攻击力
	@Override
	public String addAttack(Role role) {
			//是为了返回String给服务器，服务器将这个技能信息发送给客户端
			String msg = role.getNickname()+"使用了技能:"+skillName+",攻击力增加" + attrAttack;
			role.setAttack(role.getAttack() + attrAttack);
			availability+=skillCd;
			haveUse = true;
			return msg;
	}
	
	//添加生命值
	@Override
	public String addHeal(Role role) {
		String msg = role.getNickname()+"使用了技能:"+skillName+",生命值增加" + attrHeal;
		role.setHeal(role.getHeal() + attrHeal);
		availability+=skillCd;
		haveUse = true;
		return msg;
	}
	//添加魔法值
	@Override
	public String addImage(Role role) {
		String msg = role.getNickname()+"使用了技能:"+skillName+",魔法值增加" + attrImage;
		role.setImage(role.getImage() + attrImage);
		availability+=skillCd;
		haveUse = true;
		return msg;
	}
	//添加暴击率
	@Override
	public String addCritical(Role role) {
		String msg = role.getNickname()+"使用了技能:"+skillName+",暴击值增加" + attrCrit;
		role.setCritical(role.getCritical() + attrCrit);
		availability+=skillCd;
		haveUse = true;
		return msg;
	}
	//添加防御值
	@Override
	public String addDefense(Role role) {
		String msg = role.getNickname()+"使用了技能:"+skillName+",防御值增加" + attrDefense;
		role.setDefense(role.getDefense() + attrDefense);
		availability+=skillCd;
		haveUse = true;
		return msg;
	}
	//添加速度
	@Override
	public String addSpeed(Role role) {
		String msg = role.getNickname()+"使用了技能:"+skillName+",速度值增加" + attrSpeed;
		role.setSpeed(role.getSpeed() + attrSpeed);
		availability+=skillCd;
		haveUse = true;
		return msg;
	}
	
	public SkillBuff() {
		super();
		// TODO Auto-generated constructor stub
	}

	public SkillBuff(String skillName, String skillDesc, int skillCd, int consumBlue, String type, int attrHeal,
			int attrImage, int attrAttack, int attrCrit, int attrDefense, int attrSpeed, int duration, String classId) {
		super(skillName, skillDesc, skillCd, consumBlue, type, attrHeal, attrImage, attrAttack, attrCrit, attrDefense,
				attrSpeed, duration, classId);
		// TODO Auto-generated constructor stub
	}

	public SkillBuff(String skillId, String skillName, String skillDesc, int skillCd, int consumBlue, String type,
			int attrHeal, int attrImage, int attrAttack, int attrCrit, int attrDefense, int attrSpeed, int duration,
			String classId) {
		super(skillId, skillName, skillDesc, skillCd, consumBlue, type, attrHeal, attrImage, attrAttack, attrCrit, attrDefense,
				attrSpeed, duration, classId);
		// TODO Auto-generated constructor stub
	}

}
